home *** CD-ROM | disk | FTP | other *** search
- #include <aesbind.h>
- #include <obdefs.h>
- #include <gemdefs.h>
- #define SPEC 0x510f1L
- #define B1FLAGS 0x5
- #define B2FLAGS 0x7
-
- char input[] = "@@@@@@@@@@";
- char template[] = "Your Name:________________";
- char check[] = "FFFFFFFFFF";
- char button1[] = "Ok";
- char button2[] = "GEM";
-
- TEDINFO text[] = {
- /* text pointer(@ for none)
- * | template pointer
- * | | validate pointer
- * | | | font code character
- * | | | | any int
- * | | | | | justification code character
- * | | | | | | color code
- * | | | | | | | any int
- * | | | | | | | | border thickness(rasters)
- * | | | | | | | | | input string(char)
- * | | | | | | | | | | template str(char)
- * v v v v v v v v v v v */
- input, template, check, IBM, 1, TE_CNTR, WHITE, 5, 1, 11, 22
- };
-
- OBJECT dialogue[] = { /* set up for hirez screen */
- /*next/head/tail/ type/ flags/ state/ spec./ X/ Y/ W/ H */
- -1, 1, 3, G_BOX, NONE, NORMAL, SPEC, 0, 0,600,250,
- 2, -1, -1, G_FTEXT,EDITABLE, NORMAL, text, 100, 50,400,100,
- 3, -1, -1, G_BUTTON, B1FLAGS, NORMAL, button1, 230,200, 40, 20,
- 0, -1, -1, G_BUTTON, B2FLAGS, NORMAL, button2, 300,200, 40, 20
- };
- Rect tempbox = { 0, 0, 0, 0 };
- Prect tempptr = { &tempbox.x, &tempbox.y, &tempbox.w, &tempbox.h };
- main()
- {
- int nowhere = 0;
- int quit;
- char newstring[29] = "Your name is ";
- appl_init();
- graf_mouse(ARROW, &nowhere);
- form_center(dialogue, tempptr);
- form_dial(0, 1, 1, 1, 1, tempbox);
- form_dial(1, 1, 1, 1, 1, tempbox);
- objc_draw(dialogue, ROOT, MAX_DEPTH, tempbox);
- for(;;)
- {
- quit = form_do(dialogue, 1);
- if (quit == 2)
- {
- strcat(newstring, input);
- strcpy(template, newstring);
- objc_draw(dialogue, ROOT, MAX_DEPTH, tempbox);
- }
- if (quit == 3 )
- {
- form_dial(2, 1, 1, 1, 1, tempbox);
- form_dial(3, 1, 1, 1, 1, tempbox);
- appl_exit();
- exit(0);
- }
- } /* typed in as stated in MWC ; not yet exactly usable */
- } /* MWC pp. 361-362 6Jun'87 CJPurcell */
-